package practice.knowledge;
import java.util.Scanner;
import java.util.Random;

public class Guess_num {

    public static void main(String[] args) {

        Random r = new Random();
        int num = r.nextInt(100) + 1;

        Scanner sc = new Scanner(System.in);
        try {
            int count = 0;
            while (true) {
                count++;
                int guess_num = sc.nextInt();
                if (guess_num < num) {
                    System.out.println("猜小了");
                } else if (guess_num > num) {
                    System.out.println("猜大了");
                } else {
                    System.out.println("猜对啦"+count);
                    break;
                }
            }

        } finally {
            sc.close();
        }

    }
}